package cn.jhc.service.impl;

import cn.jhc.dao.UserDAO;
import cn.jhc.entity.User;
import cn.jhc.service.UserService;
import org.springframework.stereotype.Service;

import java.util.List;


public class UserServiceImpl implements UserService {

    private UserDAO userDAO;

    public UserDAO getUserDAO() {
        return userDAO;
    }

    public void setUserDAO(UserDAO userDAO) {
        this.userDAO = userDAO;
    }

    @Override
    public int save(User user) {
        return userDAO.save(user);
    }

    @Override
    public int update(User user) {
        return userDAO.update(user);
    }

    @Override
    public int delete(Integer userId) {
        return userDAO.delete(userId);
    }

    @Override
    public User queryOne(Integer userId) {
        return userDAO.queryOne(userId);
    }

    @Override
    public List<User> query(User user) {
        return userDAO.query(user);
    }

    @Override
    public User findUserOrders(Integer userId) {
        return userDAO.findUserOrders(userId);
    }
}
